home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / libg_261.zip / libg_261 / libg++ / etc / lf / screen.h < prev    next >
C/C++ Source or Header  |  1992-06-26  |  1KB  |  38 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. #ifndef screen_h
  3. #define screen_h 1
  4. #include <std.h>
  5. #include <stdio.h>
  6. #include <curses.h>
  7.  
  8.  
  9.  
  10. /* Handles necessary screen-manipultations. */
  11. class Screen_Handler
  12. {
  13.  private:
  14.   static char  term_entry[1024];   /* Holds termcap entry for current terminal. */
  15.   static char  temp_buf[100];      /* Holds inverse screen attributes. */
  16.   static int   width;              /* Current screen width, needed to format output. */
  17.   static char *current_ptr;        /* Pointer to current position in temp_buf. */
  18.   static char *inverse_start;      /* Control sequence beginning inverse mode. */
  19.   static char *inverse_end;        /* Control sequence ending inverse mode. */
  20.   
  21.   static void  center (char *buf); /* Prints out leading spaces to center BUF. */
  22.  
  23. public:
  24.               Screen_Handler (void);              /* Initialize the screen width. */
  25.   static int  screen_width (void);                /* Return current screen width. */
  26.   static void print_inverse_centered (char *buf); /* Centers, inverts, and prints BUF. */
  27. };
  28.  
  29. /* See comments in .cc file for inline functions. */
  30.  
  31. /* Returns current screen width. */
  32. inline int 
  33. Screen_Handler::screen_width (void)
  34. {
  35.   return width;
  36. }
  37. #endif
  38.